<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let second = +prompt('输入秒数');
        function getTime(s) {
            let h = parseInt(s / 60 / 60 % 24);
            let m = parseInt(s / 60 % 60);
            s = parseInt(s % 60);
            h = h < 10 ? '0' + h : h;
            m = m < 10 ? '0' + m : m;
            s = s < 10 ? '0' + s : s;
            return `${h}小时${m}分钟${s}秒`;
        };
        let str = getTime(second);
        document.write(str);
    </script>
</body>

</html>